package org.fengdi.account.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;;

@Data
@TableName("account")
@Getter
@Setter
@NoArgsConstructor
public class Account {
    @TableId(type = IdType.AUTO)
    public int id;

    @TableField("user_id")  // 明确指定数据库列名
    public String userId;

    @TableField("money")  // 明确指定数据库列名
    public double money;

    public Account(String userId, double money) {
        this.userId = userId;
        this.money = money;
    }

    @Override
    public String toString() {
        return "Account{" +
                "id=" + id +
                ", userId='" + userId + '\'' +
                ", money=" + money +
                '}';
    }
}
